package com.luoqiz.common.httpEntity;

import com.luoqiz.common.constant.ResponseCodeConstant;

public class HttpResponseService {

    public static HttpResponseBase setError() {
        return new HttpResponseBase(500, false, "500",
                ResponseCodeConstant.HTTP_RES_CODE_500_VALUE, null);
    }

    public static HttpResponseBase setError(int code, String status, String msg, Object data) {
        return new HttpResponseBase(code, false, status, msg, data);
    }

    public static HttpResponseBase setError(int code, String status, String msg) {
        return new HttpResponseBase(code, false, status, msg, null);
    }

    public static HttpResponseBase setError(String status, String msg, Object data) {
        return new HttpResponseBase(200, false, status, msg, data);
    }

    public static HttpResponseBase setSuccess(String code, String msg, Object data) {
        return new HttpResponseBase(code, msg, data);
    }

    public static HttpResponseBase setResult(int code, boolean success, String status, String msg, Object data) {
        return new HttpResponseBase(code, success, status, msg, data);
    }

}
